//
//  ViewController.NavigationItem.swift
//  App_Common
//
//  Created by Flutter on 2021/7/23.
//

import UIKit
import UICore

public extension ViewController {
 
    func setupNavigationBar(title: String, canBack: Bool = false) {
        navigationItem.title = title
        if canBack {
            addDefaultLeftBarButtonItem(image: CommonModular.image(named: "common_nav_back"))
//            self.navigationController?.interactivePopGestureRecognizer = true
            
            self.navigationController?.interactivePopGestureRecognizer?.isEnabled = true
            
        }else {
//            self.navigationController?.interactivePopGestureRecognizer = false
            self.navigationController?.interactivePopGestureRecognizer?.isEnabled = false
        }
        
    }
    
}
